package com.micro.common.service.web.api;


import com.micro.common.service.web.domain.req.IdReq;
import com.micro.common.service.web.domain.req.dict.DictAddReq;
import com.micro.common.service.web.domain.req.dict.DictEditReq;
import com.micro.common.service.web.domain.req.dict.DictPageListReq;
import com.micro.common.service.web.domain.resp.dict.DictDataResp;
import com.micro.framework.starter.common.data.req.PageReq;
import com.micro.framework.starter.common.data.result.PageResult;
import com.micro.framework.starter.common.data.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * @author system
 * @since 2025-04-07
 */
@RestController
@Api(value = "字典数据接口", tags = "字典数据接口")
@RequestMapping("/api/dictData")
public interface DictDataApi {

    @ApiOperation(value = "分页查询")
    @PostMapping("/pageList")
    PageResult<DictDataResp> pageList(@Valid @RequestBody PageReq<DictPageListReq> req);

    @ApiOperation(value = "新增字典数据")
    @PostMapping("/add")
    Result<Void> add(@Valid @RequestBody DictAddReq req);

    @ApiOperation(value = "修改字典数据")
    @PostMapping("/edit")
    Result<Void> edit(@Valid @RequestBody DictEditReq req);

    @ApiOperation(value = "删除数据")
    @PostMapping("/delete")
    Result<Void> delete(@Valid @RequestBody IdReq req);

    @ApiOperation(value = "导出测试- ")
    @PostMapping("/dictExport")
    void dictExport( HttpServletResponse response) throws Exception;

}
